package _12_proxy_pattern.v_dynamic_proxy.dynamic_demo;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class GamePlayIH implements InvocationHandler {
	//被代理者
	Class cls = null;
	//被代理的实例
	Object obj = null;

	//我要代理谁
	public GamePlayIH(Object _obj) {
		this.obj = _obj;
	}

	//调用被代理的方法
	@Override
	public Object invoke(Object proxy, Method method, Object[] args)
			throws Throwable {
		System.out.println("吼吼吼,前置方法!!!");
		Object result = method.invoke(this.obj, args);
		System.out.println("吼吼吼,后置方法!!!");
		return result;
	}
}